<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['shopTitle']['fieldValue']}后台管理中心</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="__CSS__/AdminLTE.css" rel="stylesheet" type="text/css" />
      <link href="__CSS__/upload.css" rel="stylesheet" type="text/css" />
      
      <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
      <script src="__PUBLIC__/js/jquery.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
      
      <script src="__PUBLIC__/plugins/formValidator/formValidator-4.1.3.js"></script>
      <script type="text/javascript" src="__JS__/upload.js"></script>
      
   </head>
   <script>
   var ThinkPHP = window.Think = {
	        "ROOT"   : "__ROOT__"
	}
   $(function () {
	   $.formValidator.initConfig({
		   theme:'Default',mode:'AutoTip',formID:"myform",debug:true,submitOnce:true,onSuccess:function(){
				   edit();
			       return false;
			}});
		$("#money").formValidator({
			onShow:"",onFocus:"请输入提现金额"
		}).inputValidator({
			min:1,max:50,onError:"请输入提现金额"
		});
		$("#account").formValidator({
			onShow:"",onFocus:"请输入银行卡号"
		}).inputValidator({
			min:2,max:50,onError:"请输入银行卡号"
		});
		$("#bankname").formValidator({
			onShow:"",onFocus:"请输入银行名称"
		}).inputValidator({
			min:2,max:50,onError:"请输入银行名称"
		});
		$("#bankaddress").formValidator({
			onShow:"",onFocus:"请输入开户银行地址"
		}).inputValidator({
			min:2,max:50,onError:"请输入开户银行地址"
		});
		$("#account_user").formValidator({
			onShow:"",onFocus:"请输入开户姓名"
		}).inputValidator({
			min:1,max:50,onError:"请输入开户姓名"
		});
		$("#mobile").formValidator({
			onShow:"",onFocus:"请输入联系电话"
		}).inputValidator({
			min:11,max:11,onError:"请输入联系电话"
		});
		$("#checkcode").formValidator({
			onShow:"",onFocus:"请输入验证码"
		}).inputValidator({
			min:4,max:4,onError:"请输入验证码"
		});
   });
   function edit(){
	   var params = {};
	   params.money = $.trim($('#money').val());
	   params.account = $.trim($('#account').val());
	   params.bankname = $.trim($('#bankname').val());
	   params.bankaddress = $.trim($('#bankaddress').val());
	   params.account_user = $.trim($('#account_user').val());
	   params.mobile = $.trim($('#mobile').val());
	   params.checkcode = $.trim($('#checkcode').val());
	   Plugins.waitTips({title:'信息提示',content:'正在提交数据，请稍后...'});
		$.post("{:U('agentApply')}",params,function(data,textStatus){
			var json = WST.toJson(data);
			if(json.status=='1'){
				Plugins.setWaitTipsMsg({ content:json.msg,timeout:1000,callback:function(){
				   location.href='{:U("infolist")}';
				}});
			}else{
				Plugins.closeWindow();
				Plugins.Tips({title:'信息提示',icon:'error',content:json.msg,timeout:1000});
			}
		});
   }
  
   </script>
   <body class="wst-page">
       <form name="myform" method="post" id="myform" autocomplete="off">          
        <table class="table table-hover table-striped table-bordered wst-form">
           <tr>
             <th width='120' align='right'>申请金额<font color='red'>*</font>：</th>
             <td>
             <input type="text" id="money" class="form-control wst-ipt" maxLength='20'/>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>银行卡号<font color='red'>*</font>：</th>
             <td>
             <input type="text" id="account" class="form-control wst-ipt" maxLength='20'/>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>银行名称<font color='red'>*</font>：</th>
             <td>
             <input type="text" id="bankname" class="form-control wst-ipt" maxLength='20'/>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>银行开户地址<font color='red'>*</font>：</th>
             <td>
             <input type="text" id="bankaddress" class="form-control wst-ipt" maxLength='20'/>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>开户姓名<font color='red'>*</font>：</th>
             <td>
             <input type="text" id="account_user" class="form-control wst-ipt" maxLength='20'/>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>联系电话<font color='red'>*</font>：</th>
             <td>
             <input type="text" id="mobile" class="form-control wst-ipt" maxLength='20'/>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>验证密<font color='red'>*</font>：</th>
             <td>
             <input type="text" id="checkcode" style="width:80px;" class="form-control wst-ipt" maxLength='4'/>
             </td>
           </tr>
           <tr>
             <td colspan='3' style='padding-left:250px;'>
                 <button type="submit" class="btn btn-success">提&nbsp;交</button>
                 <button type="button" class="btn btn-primary" onclick='javascript:location.href="{:U('infolist')}"'>返&nbsp;回</button>
             </td>
           </tr>
        </table>
       </form>
</body>
</html>